<!--以下短短38行代码竟然暗藏一个错误，若有兴趣不烦来找找。注意：仅仅只需修改一个字母即可让程序运行通过哦（并非低级的拼写错误）-->
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js"></script>
</head>
<body>
<div id="app">
	<div>
		<input v-model='msg'>
		<button @click='send'>发送</button>
	</div>
	<ul>
		<Send-Msg v-for='(item,key) of list' :isay='item' :index='key' @click='click'>
		</Send-Msg>
	</ul>
</div>
<script>
	Vue.component('SendMsg',{
		props:['isay','index'],
		template:'<li @click="click">{{isay}} {{index}}</li>',
		methods:{
			click:function(){
				this.$emit('click', this.index);
			}
		}
	})
	new Vue({
		el:'#app',
		//components:{
		//	sendmsg: myMsg
		//},
		data:{
			msg:'',
			list:[],
		},
		methods:{
			send:function(){
				this.list.push(this.msg);
				this.msg='';
			},
			click:function(x){
				this.list.splice(x,1);
			}
		}
	});
</script>
</html>